<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
		<meta http-equiv="content-language" content="de" />
		<meta http-equiv="content-type" content="text/html; charset=utf-8;" />
		<title>railbrowser v{{$version}}</title>
		<script type="text/javascript">
			var djConfig = {
//				isDebug:true,
				usePlainJson:true
			};
		</script>
		<script type="text/javascript" src="{{$resources_dir}}/dojo-release-1.0.2/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
		<script type="text/javascript" src="{{$resources_dir}}/ajaxBridge/ajaxBridge.js"></script>
		<script type="text/javascript" src="railbrowser.js"></script>
		<script type="text/javascript">
			// some dojo imports
			dojo.require("dojo.parser");
			dojo.require("dojo.data.ItemFileReadStore");
			dojo.require("dijit.Dialog");
			dojo.require("dijit.form.Button");
			dojo.require("dijit.form.CheckBox");
			dojo.require("dijit.form.FilteringSelect");
			dojo.require("dijit.form.TextBox");
			dojo.require("dijit.layout.AccordionContainer");
			dojo.require("dijit.layout.ContentPane");
			dojo.require("dijit.layout.LayoutContainer");
			dojo.require("dijit.layout.TabContainer");
			dojo.require("dijit.Toolbar");
			dojo.require("dijit.Menu");

			dojo.addOnLoad(
    			function(){
			    	object_load({{$object}});
   				 }
			);

		</script>
		<link rel="stylesheet" type="text/css" href="{{$resources_dir}}/dojo-release-1.0.2/dijit/themes/tundra/tundra.css" media="all" />
		<link rel="stylesheet" type="text/css" href="{{$resources_dir}}/dojo-release-1.0.2/dojo/resources/dojo.css" media="all" />
		<link rel="stylesheet" type="text/css" href="railbrowser.css" media="all" />
	</head>

	<body class="tundra">

		<div id="header">
			<!-- ** menu -->
			<a id="menu" title="Menü" ><span class="htext">railbrowser</span></a>
			<div dojoType="dijit.Menu" targetNodeIds="menu"
				 leftClickToOpen="true"
                 style="display: none;">
				<div dojoType="dijit.MenuItem" onClick="alert('railbrowser {{$version}}\n\nDer railbrowser ist ein virtueller Objektmanager. Mehr Informationen auf www.open-rail.org\n');">Über railbrowser</div>
				<span dojoType="dijit.MenuSeparator"></span>
				<div dojoType="dijit.PopupMenuItem">
                    <span>Neu</span>
                    <div dojoType="dijit.Menu">
                    	<div id="menu_addAttribute" dojoType="dijit.MenuItem"
                 			 iconClass="icon_addAttribute"
                 			 onClick="dijit.byId('add_attribute').show();">
                    		Attribute hinzufügen
                    	</div>
                		<div id="menu_addObject" dojoType="dijit.MenuItem"
                 			 iconClass="icon_addAObject"
                 			 onClick="dijit.byId('add_object').show();">
                			Objekt hinzufügen
                		</div>
                    </div>
                </div>
                <span dojoType="dijit.MenuSeparator"></span>
                <div id="menu_cut" dojoType="dijit.MenuItem" iconClass="icon_cut" onClick="object_cut();">Ausschneiden</div>
			    <div id="menu_copy" dojoType="dijit.MenuItem" iconClass="icon_copy" onClick="object_copy();">Kopieren</div>
			    <div id="menu_paste" dojoType="dijit.MenuItem" iconClass="icon_paste" onClick="object_paste();">Einfügen</div>
			    <div id="menu_delete" dojoType="dijit.MenuItem" iconClass="icon_delete" onClick="object_delete();">Löschen</div>
			    <span dojoType="dijit.MenuSeparator"></span>
			    <div dojoType="dijit.MenuItem" onClick="{{$href_onclick}}">Beenden</div>
        	</div>

        	<!-- ** selector -->
			<form id="locate_form" name="locate_form">
				<label><select dojoType="dijit.form.ComboBox" id="rail_path"
					name="rail_path"
	                style="width: 425px;">
						<option value="/">/</option>
						<option value="{{$users_home}}">{{$users_home}}</option>
					</select>
				</label>
				<label>#<input dojoType="dijit.form.TextBox" id="rail_id"
	                name="rail_id"
	                style="width: 40px;" />
				</label>
				&nbsp;<button dojoType=dijit.form.Button type="button" onclick="object_locate();">Ok</button>
			</form>
		</div>

		<div id="left">
			<!-- ** info -->
			<table id="info">
				<tr>
					<td id="obj_icon" class="RAIL_CONTAINER">
						<span><img src="img/object_empty.png" border="0" /></span>
					</td>
					<td id="obj_info"></td>
				</tr>
			</table>

			<div dojoType="dijit.layout.AccordionContainer" duration="200" id="accordion">

				<!-- ** attributes -->
                <div dojoType="dijit.layout.AccordionPane" selected="true" title="Alle Attribute">
					<form id="attributes_form" name="attributes_form"></form>
                </div>

                <!-- ** relations -->
                <div dojoType="dijit.layout.AccordionPane" title="Alle Beziehungen">
					<div id="relations_pane"></div>
                </div>

                <!-- ** rights -->
                <div dojoType="dijit.layout.AccordionPane" title="Besitzer & Rechte">
                	<form id="rights_form" name="rights_form">
						<label>
						<h3>Besitzer:</h3>
						<input dojoType="dijit.form.FilteringSelect"
						    id="rights_user"
							name="rights_user"
							autocomplete="true"
							style="width: 120px;" />
						<select dojoType="dijit.form.FilteringSelect"
						    id="rights_user_mode"
							name="rights_user_mode"
							autocomplete="true"
							style="width: 68px;">
							<option value="6">rw-</option>
							<option value="4">r--</option>
							<option value="0">---</option>
						</select>
						</label>
						<label>
						<h3>Gruppe:</h3>
						<input dojoType="dijit.form.FilteringSelect"
						    id="rights_group"
							name="rights_group"
							autocomplete="true"
							style="width: 120px;" />
						<select dojoType="dijit.form.FilteringSelect"
						    id="rights_group_mode"
							name="rights_group_mode"
							autocomplete="true"
							style="width: 68px;">
							<option value="6">rw-</option>
							<option value="4">r--</option>
							<option value="0">---</option>
						</select>
						</label>
						<label>
						<h3>Andere:</h3>
						<select dojoType="dijit.form.FilteringSelect"
						    id="right_other"
							name="right_other"
							autocomplete="true"
							style="margin-left: 127px; width: 68px;">
							<option value="6">rw-</option>
							<option value="4">r--</option>
							<option value="0">---</option>
						</select>
						</label>
						<button id="rights_save" dojoType=dijit.form.Button type="button" onclick="rights_update();">Rechte speichern</button><br />
						<input id="rights_rekursiv" name="rights_rekursiv"
				            dojoType="dijit.form.CheckBox" /> Änderungen rekursiv auf alle Objekte im Inventar anwenden.
					</form>
        		</div>
			</div>
        </div>

        <!-- ** inventory -->
        <div id="inventory"></div>


        <!-- ** Dialog add_attribute -->
		<div dojoType="dijit.Dialog" id="add_attribute" title="Attribute hinzufügen" refreshOnShow="true">
			<form id="add_attribute_form" name="add_attribute_form" method="POST" class="dialog">
				<label>
					<span class="ftext">Attribute</span>
					<input type="text" name="attribute"
		                dojoType="dijit.form.TextBox"
		                trim="true"
		                style="width: 145px;" />
				</label>
				<label>
					<span class="ftext">Wert</span>
					<input type="text" name="value"
		                dojoType="dijit.form.TextBox"
		                trim="true"
		                style="width: 145px;" />
				</label>
				<button dojoType=dijit.form.Button type="button" onclick="attribute_add();">Hinzufügen</button>
				</form>
		</div>

        <!-- ** Dialog add_object -->
		<div dojoType="dijit.Dialog" id="add_object" title="Objekt hinzufügen" refreshOnShow="true">
			<form id="add_object_form" name="add_object_form" method="POST" class="dialog">
				<label>
					<span class="ftext">Name</span>
					<input type="text" name="name"
		                dojoType="dijit.form.TextBox"
		                trim="true"
		                 />
				</label>
				<label>
					<span class="ftext">Typ</span>
					<select name="type"
		                	dojoType="dijit.form.ComboBox"
		                	trim="true"
		                 	/>
						<option value="rail_object">rail_object</option>
						<option value="rail_container">rail_container</option>
						<option value="rail_document">rail_document</option>
						<option value="rail_group">rail_group</option>
						<option value="rail_link">rail_link</option>
						<option value="rail_sequence">rail_sequence</option>
						<option value="rail_user">rail_user</option>
					</select>
				</label>
				<button dojoType=dijit.form.Button type="button" onclick="object_add();">Hinzufügen</button>
				</form>
		</div>

	</body>
</html>